package com.google.gwt.sample.dynatablerf.client.views;

import com.google.gwt.event.dom.client.HasClickHandlers;
import com.google.gwt.sample.dynatablerf.client.presenters.StartPresenter.StartDisplay;
import com.google.gwt.sample.dynatablerf.client.theme.GrifoTheme;
import com.google.gwt.sample.dynatablerf.client.theme.GrifoTheme.GrifoImageResources;
import com.google.gwt.sample.dynatablerf.client.util.GrifoConstants;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.HorizontalPanel;
import com.google.gwt.user.client.ui.Image;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.Widget;

public class StartView extends Composite implements StartDisplay {

	private Button button;

	public StartView() {

		HorizontalPanel horizontalPanel = new HorizontalPanel();
		initWidget(horizontalPanel);

		Image image = new Image(GrifoImageResources.INSTANCE.iconProjetos());

		Label label = GrifoTheme.getLabelPadrao();
		label.setText(GrifoConstants.INSTANCE.projetos());

		button = GrifoTheme.getButtonPadrao(image, label);

		horizontalPanel.add(button);

	}

	@Override
	public Widget getTabHeader() {
		HorizontalPanel horizontalPanel = new HorizontalPanel();
		Label label = GrifoTheme.getLabelPadrao();
		label.setText(GrifoConstants.INSTANCE.inicio());
		horizontalPanel.add(label);
		return horizontalPanel;
	}

	@Override
	public HasClickHandlers getGoToProjetListClickHandlers() {
		return button;
	}

}
